package com.weitu.contractor.service.impl;

import com.weitu.contractor.entity.ContractorAuditHistory;
import com.weitu.contractor.entity.ContractorAuditHistoryCriteria;
import com.weitu.contractor.mapper.ContractorAuditHistoryMapper;
import com.weitu.contractor.service.ContractorAuditHistoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ContractorAuditHistoryServiceImpl implements ContractorAuditHistoryService {
    private final ContractorAuditHistoryMapper contractorAuditHistoryMapper;

    private static final Logger logger = LoggerFactory.getLogger(ContractorAuditHistoryServiceImpl.class);

    @Autowired
    public ContractorAuditHistoryServiceImpl(ContractorAuditHistoryMapper contractorAuditHistoryMapper) {
        this.contractorAuditHistoryMapper = contractorAuditHistoryMapper;
    }

    @Override
    public int countByCriteria(ContractorAuditHistoryCriteria example) {
        int count = this.contractorAuditHistoryMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public ContractorAuditHistory selectByPrimaryKey(String id) {
        return this.contractorAuditHistoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ContractorAuditHistory> selectByCriteria(ContractorAuditHistoryCriteria example) {
        return this.contractorAuditHistoryMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.contractorAuditHistoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(ContractorAuditHistory record) {
        return this.contractorAuditHistoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(ContractorAuditHistory record, ContractorAuditHistoryCriteria example) {
        return this.contractorAuditHistoryMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(ContractorAuditHistory record) {
        return this.contractorAuditHistoryMapper.insertSelective(record);
    }
}